package com.jack.payment.entity.result;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@Schema(name = "分页数据返回")
@JsonInclude(value=JsonInclude.Include.NON_NULL)
public class PageVo<T1> implements Serializable {
    @Schema(description = "公共返回参数")
    private List<T1> pageList;
    @Schema(description = "数据总共多少页")
    private Integer pageCount;
    @Schema(description = "当前是第几页")
    private Integer currentPage;
    @Schema(description = "数据总条数")
    private Integer total;
    @Schema(description = "附加数据")
    private Object attach;

    public PageVo(List<T1> pageList,
                  Integer pageCount,
                  Integer currentPage) {
        this.pageList = pageList;
        this.pageCount = pageCount;
        this.currentPage = currentPage;
    }

    public PageVo(List<T1> pageList,
                  Integer pageCount,
                  Integer currentPage,
                  Integer total,
                  Object attach) {
        this.pageList = pageList;
        this.pageCount = pageCount;
        this.currentPage = currentPage;
        this.total = total;
        this.attach = attach;
    }

    public PageVo(List<T1> pageList,
                  Integer pageCount,
                  Integer currentPage,
                  Integer total) {
        this.pageList = pageList;
        this.pageCount = pageCount;
        this.currentPage = currentPage;
        this.total = total;
    }
}
